<%-- 
    Document   : movie_list
    Created on : 2020-5-25, 11:40:03
    Author     : Lenovo
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page import="com.qdu.entity.Movie"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
     
        <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/script3.js" charset="UTF-8"></script>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

        
    </head>
    <body>
<!--              <nav class="navbar navbar-inverse">
  <div class="container-fluid btn-group-lg">
     Brand and toggle get grouped for better mobile display 
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

     Collect the nav links, forms, and other content for toggling 
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li>
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">One more separated link</a></li>
          </ul>
        </li>
      </ul>
      <form class="navbar-form navbar-left">
        <div class="form-group">
          <input type="text" class="form-control" placeholder="Search">
        </div>
        <button type="submit" class="btn btn-default">Submit</button>
      </form>
      <ul class="nav navbar-nav navbar-right">
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Action</a></li>
            <li><a href="#">Another action</a></li>
            <li><a href="#">Something else here</a></li>
            <li role="separator" class="divider"></li>
            <li><a href="#">Separated link</a></li>
          </ul>
        </li>
      </ul>
    </div> /.navbar-collapse 
  </div> /.container-fluid 
</nav>-->
        
        
       <div class="page-header">
  <h1>电影列表 <small>用于查看添加修改删除电影</small></h1>
</div>
         <div class="panel panel-primary">
            <!-- Default panel contents -->
            <div class="panel-heading">HELLO</div>
            <div class="panel-body">
                <p>这里显示已经存在的电影
                 <a class="btn btn-primary btn-sm" href="http://localhost:8084/J01_T05_P01/bu.jsp" role="button">返回</a></p>
            </div>


        </div>
        
        <button type="button" class="btn btn-default btn-lg btn-success " id="btn_showAddModal" >
  <span class="glyphicon glyphicon-star" aria-hidden="true"></span>添加新电影
</button>
            <hr>
             <%

                List<Movie> list = (List<Movie>) request.getAttribute("all_movies");
                session.setAttribute("list1", list);

            %>
            <c:forEach items="${sessionScope.list1}" var="m">
                <hr>
                <div class="text-center caption">
                <a class="item" target="_blank" href="gmis?movieId=${m.movieId}">
                    <p>
                    <table class="table">
                        <!--中文名和评分-->
                          <tr id="tr${m.movieId}">
                            
                              <td><h4>${m.movieId}</h4></td>
                          
                          <td><h4>${m.mchineseName}</h4></td>
<!--                          <td> <img src="images/${m.mcover}" alt="${m.mchineseName}"> </td>-->
                          <td><h4>[${m.mrating}]</h4></td>
                          </tr>
                          </table>
                </a>
                         <br>
                         <p>   <a class=" btn btn-primary link_showAddModal glyphicon glyphicon-scissors"  role="button" href="javascript:showModifyModal('#tr${m.movieId}');">编辑</a>&nbsp;&nbsp;&nbsp;&nbsp;
                             <a  class="btn btn-default glyphicon glyphicon-remove"  role="button" href="javascript:deleteBook('${m.movieId}');">删除</a></p>
                         <br><br><br><hr>
                </div>
            </c:forEach>

            <c:set var="item" value="2"/>


        </div>
        <div class="modal fade" id="add_modal" tabindex="-1">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title text-success" id="myModalLabel">添加新电影</h4>
                    </div>
                    <div class="modal-body">
                        <form class="form-inline" id="add_form">
                            <label for="ibId">电影号：</label>
                            <input id="ibId" type="text" name="bId" placeholder="输入电影" class="form-control sinfo">
                            <br><br>
                            <label for="ibName">电影名：</label>
                            <input id="ibName" type="text" name="bName" placeholder="输入电影名" class="form-control sinfo">
<!--                            <br><br>
                            <label for="ibCover">电影海报：</label>
                            <input id="ibCover" type="text" name="bCover"  placeholder="电影封面" class="form-control sinfo">-->
                              <br><br>
                            <label for="ibrating">评分：</label>
                            <input id="ibrating" type="text" name="brating" placeholder="在此输入电影评分" class="form-control sinfo">

                        </form>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                        <button type="button" id="btn_add" class="btn btn-primary">保存添加</button>
                    </div>
                </div>
            </div>
        </div>

             <div class="modal fade" id="modify_modal" tabindex="-1">
                <div class="modal-dialog">
                    <div class="bg-warn modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title text-danger" id="myModalLabel">编辑电影信息</h4>
                        </div>
                        <div class="modal-body">
                            <form class="form-inline" id="modify_form">
                                <label for="ibId">电影号：</label>
                                <input id="ibId" readonly type="text" name="bId" class="form-control" >
                                <br><br>
                                <label for="ibName">电影名：</label>
                                <input id="ibName" type="text" name="bName" class="form-control">
                                <br><br>
                                <label for="ibrating">评分：</label>
                                <input id="ibrating" type="text" name="brating" class="form-control">              
                            </form>
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-warning" data-dismiss="modal">取消</button>
                            <button type="button" id="btn_modify" class="btn btn-danger">保存修改</button>
                        </div>
                    </div>
                </div>
            </div>
    </body>
</html>


